#pragma once
#include <QObject>

class bsv_param : public QObject {
	Q_OBJECT

public:
	bsv_param(QObject * parent = Q_NULLPTR);
	~bsv_param();


	static void load(const QObject* myObject, QString strJsonFile);

	static void write(const QObject* myObject, QString strJsonFile);


private:
	
};

void write_set(int value, QString key, QString set_file, QString section="SETTINGS");
void write_set(double value, QString key, QString set_file, QString section = "SETTINGS");
void write_set(QString value, QString key, QString set_file, QString section = "SETTINGS");
void get_set(int& value, QString key, QString set_file, int defaval = 0, QString section = "SETTINGS");
void get_set(double& value, QString key, QString set_file, double defaval = 0, QString section = "SETTINGS");
void get_set(QString& value, QString key, QString set_file, QString defaval = "", QString section = "SETTINGS");

void write_set(const std::vector<int>& value, QString key, QString set_file, QString section = "SETTINGS");
void write_set(const std::vector<double>& value, QString key, QString set_file, QString section = "SETTINGS");
void get_set(std::vector<int>& value, QString key, QString set_file, QString defaval, QString section = "SETTINGS");
void get_set(std::vector<double>& value, QString key, QString set_file, QString defaval, QString section = "SETTINGS");

QString get_p_v(QString camName, const QStringList& paramList, QString key);
QString get_p_v(const QStringList& paramList, QString key);
